﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPage/AdminMasterPage.master" AutoEventWireup="true" CodeFile="Fin002.aspx.cs" Inherits="Admin_Fin_Fin002" %>

<asp:Content ID="Content1" ContentPlaceHolderID="phScript" Runat="Server">
    <script type="text/javascript" src="/Scripts/Controls/DatePicker/WdatePicker.js""></script>
    <script type="text/javascript">
        function PrintLabel()
        {
            var checkList = $(".pagnationtable input:checked");
            if (checkList.length >8)
            {
                alert('选择的记录数不能超过8条。(当前选择：' + checkList.length + '条)');
                return;
            }
            if (checkList.length > 0) {
                var ids = "";
                checkList.each(function () {
                    ids += $(this).parent().attr("data-boxid") + ",";
                });

                OpenWindow('标签打印', 'P', '/Admin/Fin/Fin002d.aspx?type=P&boxids='+ids, 1200, 740)
            }
            else {
                alert("请选择您要打印的凭证盒标签!");
            }
        }

        $(function () {
            $("span").each(function () {
                if ($(this).attr("data-recount") == '0')
                {
                    $(this).find("input").hide();
                }
            });
        });

    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div style="width: 100%; min-width: 700px">
        <div style="padding-right: 12px; display: block;">
            <table width="100%" cellspacing="2" cellpadding="2" class="AddTable" align="left">
               
              
                 <tr>
                    <td width="45px">
                        日期:
                    </td>
                    <td>
                       <span style="color: #000;">
                    <input class="Wdate textBox" style="width: 180px;" runat="server" readonly="readonly"
                        type="text" id="txtStartDate" clientidmode="Static" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'txtEndate\')||$dp.$DV(\'9998-12-31\')}'})" />&nbsp;&nbsp;至&nbsp;&nbsp;
                    <input class="Wdate textBox" runat="server" readonly="readonly" type="text" id="txtEndate"
                        clientidmode="Static" style="width: 180px;" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'txtStartDate\');}',maxDate:'9998-12-31'})" />
                </span>
                    <span style="margin-left:8px">
                    <asp:Button id="btnSearch" runat="server" Text="搜索" OnClick="btnSearch_Click" /></span>
                    </td>
                    <td>
                    </td>
                    <td width="90px">
                       <%--<a class="style4" href="javascript:OpenWindow('标签打印','P','/Admin/Fin/Fin002b.aspx?type=P',680,580)">标签打印</a>--%>
                       <a class="style4" onclick="PrintLabel()" href="#">标签打印</a>
                       <%-- <%=GetLink("标签打印","P","Fin002b.aspx", null, 680, 580,false, null)%>--%>
                    </td>
                    <td width="56px" align="center">
                        <%=GetAddLink("Fin002a.aspx", null, 600, 500)%>
                    </td>
                </tr>
            </table>
        </div>
        <yncWeb:PagnationGrid PageSize="30" ID="pageGrid" runat="server" OnOnPageIndexChange="PageChanged">
            <HeaderTemplate>
                <table width="100%" cellspacing="0" cellpadding="0" class="pagnationtable" align="left">
                    <thead>
                        <tr>
                            <th width="40px">
                                序号
                            </th>
                            <th width="80px">
                                日期
                            </th>
                            <th width="110px">
                                盒子编号
                            </th>
                            <th>
                                凭证类型
                            </th>
                            <th>
                                存储地点
                            </th>
                            <th>
                                公司名称(代码)
                            </th>
                            <th>职能部门</th>
                            <th width="100px">
                                凭证数量
                            </th>
                          <%--  <th width="80px">
                                状态
                            </th>--%>
                            <th width="80px">
                                存储状态
                            </th>
                            <th width="120px">
                                创建人
                            </th>
                            <th width="100px">
                                创建日期
                            </th>
                            <th width="140px" class="center">
                                操作
                            </th>
                        </tr>
                    </thead>
                    <tbody>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td>
                        
                        <%# Container.ItemIndex +1 %> <asp:CheckBox ID="chk_sel"  data-recount="<%# Eval(VBoxReceiptsMetadata.ColumnNames.ReceiptCount) %>" class="sel_class" runat="server" data-boxid="<%# Eval(FinReceiptMetadata.ColumnNames.BoxID) %>"/>
                       
                         <asp:Label ID="lbBoxID" runat="server" Visible="false" Text = "<%# Eval(FinReceiptMetadata.ColumnNames.BoxID) %>"></asp:Label>
                    </td>
                    <td>
                        <%# Eval(VBoxReceiptsMetadata.ColumnNames.BoxYear)%>-<%#Eval(VBoxReceiptsMetadata.ColumnNames.BoxMonth)%>
                    </td>
                    <td>
                        <%# Eval(VBoxReceiptsMetadata.ColumnNames.BoxYear)%><%# ((int)Eval(VBoxReceiptsMetadata.ColumnNames.ReceiptCount)).ToString().PadLeft(3,'0')%><%# Eval(VBoxReceiptsMetadata.ColumnNames.BoxIndex).ToString().PadLeft(3,'0')%>
                    </td>
                    <td>
                        <%# Eval(VBoxReceiptsMetadata.ColumnNames.DocTypeName)%>
                    </td>
                    <td>
                        <%# Eval(VBoxReceiptsMetadata.ColumnNames.LocationNmae)%>
                    </td>
                    <td>
                        <%# Eval(VBoxReceiptsMetadata.ColumnNames.CompanyInfo)%>
                    </td>
                    <td>
                        <%# Eval(VBoxReceiptsMetadata.ColumnNames.DeptName)%>
                    </td>
                    <td>
                        <%# Eval(VBoxReceiptsMetadata.ColumnNames.ReceiptCount)%>
                        [<%# GetLink("凭证管理", "V", "Fin002b.aspx", Container.DataItem, 980, 680, false, VBoxReceiptsMetadata.ColumnNames.BoxID)%>]
                    </td>
                   <%-- <td>
                        <%# GetOpenClose( Eval(VBoxReceiptsMetadata.ColumnNames.IsOpen))%>
                    </td>--%>
                    <td>
                        <%# Eval(VBoxReceiptsMetadata.ColumnNames.StorageStatusName)%>
                    </td>
                    <td>
                        <%# Eval(VBoxReceiptsMetadata.ColumnNames.CreatedBy)%>
                    </td>
                    <td>
                        <%# Eval(VBoxReceiptsMetadata.ColumnNames.CreatedDttm).FormatDate(ConstantValue.DateFormat)%>
                    </td>
                    <td class="center action">
                       <%#GetActionUrl(Eval(VBoxReceiptsMetadata.ColumnNames.StorageStatus).ToString(),Container.DataItem,(int)Eval(VBoxReceiptsMetadata.ColumnNames.ReceiptCount)) %>
                    </td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
                </tbody> </table>
            </FooterTemplate>
        </yncWeb:PagnationGrid>
    </div>
</asp:Content>

